#include <stdio.h>

int gcd(int a, int b);

int main(void)
{
    printf("%d\n", gcd(3,6));
    printf("%d\n", gcd(3,10));
    printf("%d\n", gcd(4,20));
    printf("%d\n", gcd(7,22));
    return 0;
}


int gcd(int a, int b)
{
    return b == 0 ? a : gcd(b, a % b);
}
